/*
*    Phantom v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
// MinionLib.h : main header file for the MinionLib DLL
//

#pragma once

//#ifndef __AFXWIN_H__
//	#error include 'stdafx.h' before including this file for PCH
//#endif

#include "stdafx.h"
#include "windows.h"

//#include "resource.h"		// main symbols

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////

// The .lib file *EXPORTS* all, since the DLL will provide
// to the minion caller.  Therefore, the DLL and this lib must
// provide MINION_EXPORTS.  The caller does not, and links to the
// DLL, never this .lib directly.
#if !defined(MINION_EXPORTS)
	#define MINIONLIBAPI extern "C" __declspec(dllimport)
  //#define MINIONLIBAPI __declspec(dllimport)
  #define MINIONLIB_CLASS_API __declspec(dllimport)
#else
  #define MINIONLIBAPI extern "C" __declspec(dllexport)
  //#define MINIONLIBAPI __declspec(dllexport)
	#define MINIONLIB_CLASS_API __declspec(dllexport)
#endif

#define MINION_DOFUNCTION      101000
#define MINION_SETINTTYPE      102001
#define MINION_SETSTRINGTYPE   102002
#define MINION_SETREALTYPE     102003
#define MINION_SETBOOLTYPE     102004
#define MINION_SETVOIDTYPE     102005

#define FLG_FUNC_TYPE    1
#define FLG_INT_TYPE     2
#define FLG_STRING_TYPE  4
#define FLG_REAL_TYPE    8
#define FLG_VOID_TYPE    16
#define FLG_BOOL_TYPE    32

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////


// CMinionLibApp
// See MinionLib.cpp for the implementation of this class
//

/*
class CMinionLibApp : public CWinApp
{
public:
	CMinionLibApp();

// Overrides
public:
	virtual BOOL InitInstance();

	DECLARE_MESSAGE_MAP()
};
*/

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////

class MINIONLIB_CLASS_API CMinionManager;
class SSI_FunctionAPI;
class String;

int SetMinionHook(DWORD dwThreadId, HOOKPROC InProc);
void ClearMinionSync();
int WaitForSync(int Count);
HHOOK GetGlobalHook();
DWORD GetGlobalCallerThread();
SetMinionMsgFlags(int NEW_TYPE);
MINIONLIBAPI void SetMinionSync(int NEW);
MINIONLIBAPI CMinionManager* GetGlobalManager();
LRESULT MinionMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
MINIONLIBAPI int ReadAPI(SSI_FunctionAPI& RetAPI, String& InClass, String& InExtra, CMinionManager* Mgr);
void SetModuleHandle(HINSTANCE Hnd);
void MinionLog(const char* Msg);